package org.example.music_sys.controlller;

import org.example.music_sys.entity.Admin;
import org.example.music_sys.mapper.AdminMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class HelloController {

    @Autowired
    private AdminMapper adminMapper;

    @RequestMapping("/hello")
    public String hello(){
        return "<h1 style='color:red'>Hello,SpringBoot!!!</h1>";
    }

    @RequestMapping("/hi")
    public String hi(){
        return "你好，这是第一个springboot程序";
    }


    @RequestMapping("/admin/all")
    public List<Admin> selectAll(){
        return adminMapper.selectList(null);
    }

}
